package com.gwnet.shop.service.impl;

import java.util.List;

import com.gwnet.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gwnet.shop.mapper.ShopBannerMapper;
import com.gwnet.shop.domain.ShopBanner;
import com.gwnet.shop.service.IShopBannerService;

import javax.annotation.Resource;

/**
 * 商城轮播图Service业务层处理
 * 
 * @author 张万鹏
 * @date 2024-07-26
 */
@Service
public class ShopBannerServiceImpl implements IShopBannerService 
{
    @Resource
    private ShopBannerMapper shopBannerMapper;

    /**
     * 查询商城轮播图
     * 
     * @param id 商城轮播图主键
     * @return 商城轮播图
     */
    @Override
    public ShopBanner selectShopBannerById(Long id)
    {
        return shopBannerMapper.selectShopBannerById(id);
    }

    /**
     * 查询商城轮播图列表
     * 
     * @param shopBanner 商城轮播图
     * @return 商城轮播图
     */
    @Override
    public List<ShopBanner> selectShopBannerList(ShopBanner shopBanner)
    {
        return shopBannerMapper.selectShopBannerList(shopBanner);
    }

    /**
     * 新增商城轮播图
     * 
     * @param shopBanner 商城轮播图
     * @return 结果
     */
    @Override
    public int insertShopBanner(ShopBanner shopBanner)
    {
        shopBanner.setCreateTime(DateUtils.getNowDate());
        return shopBannerMapper.insertShopBanner(shopBanner);
    }

    /**
     * 修改商城轮播图
     * 
     * @param shopBanner 商城轮播图
     * @return 结果
     */
    @Override
    public int updateShopBanner(ShopBanner shopBanner)
    {
        shopBanner.setUpdateTime(DateUtils.getNowDate());
        return shopBannerMapper.updateShopBanner(shopBanner);
    }

    /**
     * 批量删除商城轮播图
     * 
     * @param ids 需要删除的商城轮播图主键
     * @return 结果
     */
    @Override
    public int deleteShopBannerByIds(Long[] ids)
    {
        return shopBannerMapper.deleteShopBannerByIds(ids);
    }

    /**
     * 删除商城轮播图信息
     * 
     * @param id 商城轮播图主键
     * @return 结果
     */
    @Override
    public int deleteShopBannerById(Long id)
    {
        return shopBannerMapper.deleteShopBannerById(id);
    }
}
